package org.footito.android.ui.activity;

import greendroid.app.ActionBarActivity;
import greendroid.app.GDTabActivity;

import org.footito.android.R;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;

public class InfoTabActivity extends GDTabActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

		getActionBar().setTitle("Informations");
        
        final String aboutText =  getString(R.string.tabdev);
        final Intent aboutIntent = new Intent(this, AboutDevActivity.class);
        aboutIntent.putExtra(ActionBarActivity.GD_ACTION_BAR_VISIBILITY, View.GONE);
        addTab(aboutText, aboutText, aboutIntent);

        final String licenseText =  getString(R.string.tablicenses);
        final Intent licenseIntent = new Intent(this, LicensesActivity.class);
        addTab(licenseText, licenseText, licenseIntent);
    }
    
    @Override
    public int createLayout() {
        return R.layout.info;
    }

	public static void startActivity(Context context) {
		Intent intent = new Intent(context, InfoTabActivity.class);
		context.startActivity(intent);
	}

    public void onAppUrlClicked(View v) {
        final Uri appUri = Uri.parse(getString(R.string.website_url));
        startActivity(new Intent(Intent.ACTION_VIEW, appUri));
    }
}
